	<template>
	<div class="homeSty">
	 <h3 class="newTitle">{{newList.title}}</h3>
	 <p class="newDetail">
	 	<span>发表时间：{{newList.add_time|dateFormat}}</span>
	 	<span>点击：{{newList.click}}次</span>
	 </p>
	 <p class="newContent" v-html="newList.content">
	 </p>
	 <comment :id="id"></comment>
	</div>
	</template>


	<script>
	import comment from '../sub-components/comment.vue'
	export default{	
	  data(){
	    return{
	      newList:{}

	    }
	  },
	  components:{
	  	comment
	  },
	  props:["id"],
	  created(){
	  console.log('123')
	  this.getNewList()

	  },
	  methods:{
	     async getNewList(){
	     console.log('104')
	   	const {data}=await this.$http.get(`/api/getnew/${this.id}`)
	   	if(data.status===0) this.newList=data.message[0]
	   }
	}
	}
	</script>

	<style lang="less">
	.homeSty{
		padding: 10px;
		padding-bottom:50px;
		.newTitle{
			font-size: 22px;
			color:#000;
		}
		.newDetail{
			font-size: 14px;
			color:#26a2ff;
			display: flex;
			justify-content:space-between;
			align-items: center;
		}
		.newContent{
			font-size: 18px;
			color:#ccc;
		}
		
	}

	</style>	
